/*
 * Click nbfs://nbhost/SystemFileSystem/Templates/Licenses/license-default.txt to change this license
 * Click nbfs://nbhost/SystemFileSystem/Templates/Classes/Class.java to edit this template
 */
package com.yxw.live_vod_boot.vo;


import java.util.concurrent.Delayed;
import java.util.concurrent.TimeUnit;
/**
 *
 * @author Administrator
 */
public class CheckLiveIsActiveVO implements Delayed{

    private String redisKey;
    private String mapKey;
    private int checkType;//0:CheckLiveIsActive,0:CheckLiveIsOver
    private Long checkTime;
    private Integer execCount;
    private LiveInDelayCacheVO liveInCacheVO;
    public void InIt(String redisKeyTmp,String mapKeyTmp,Long checkTimeTmp,int checkTypeTmp)
    {
        redisKey = redisKeyTmp;
        mapKey = mapKeyTmp;
        checkTime = checkTimeTmp;
        checkType = checkTypeTmp;
    }
    @Override
    public long getDelay(TimeUnit unit) {
        return checkTime - System.currentTimeMillis();
    }
 
    @Override
    public int compareTo(Delayed o) {
        CheckLiveIsActiveVO item = (CheckLiveIsActiveVO) o;
        long diff = this.checkTime - item.checkTime;
        if (diff <= 0) 
        {
            return -1;
        }
        else 
        {
            return 1;
        }
    }    
    public static CheckLiveIsActiveVO getCheckLiveIsActiveVO(String redisKeyTmp,String mapKeyTmp,Long checkTimeTmp,int checkTypeTmp)
    {
        CheckLiveIsActiveVO oCheckLiveIsActiveVO = new CheckLiveIsActiveVO();
        oCheckLiveIsActiveVO.InIt(redisKeyTmp,mapKeyTmp,checkTimeTmp,checkTypeTmp);        
        return oCheckLiveIsActiveVO;
    }
    public String getRedisKey() {
        return redisKey;
    }
    
    public String getMapKey() {
        return mapKey;
    }
    
    public Long getCheckTime() {
        return checkTime;
    }

    public int getCheckType() {
        return checkType;
    }

    public Integer getExecCount() {
        return execCount;
    }

    public void  setExecCount(Integer execCountTmp) {
        this.execCount = execCountTmp;
    }

    public LiveInDelayCacheVO getLiveInCacheVO() {
        return liveInCacheVO;
    }

    public void setLiveInCacheVO(LiveInDelayCacheVO liveInCacheVOTmp) {
        this.liveInCacheVO = liveInCacheVOTmp;
    }


}
